<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <link rel="stylesheet" type="text/css" media="screen" href="../css/bootstrap.min.css">
</head>
<body>
<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
    <ul id="tree" class="ztree" style="height: 100%"></ul>
</div>
<link rel="stylesheet" type="text/css" media="screen" href="../css/bootstrap.min.css">
<link rel="stylesheet" href="../css/ztree/zTreeStyle/zTreeStyle.css" type="text/css">
<link rel="stylesheet" href="../css/ztree/demo.css" type="text/css">
<script type="text/javascript" src="../js/libs/jquery-2.1.1.min.js"></script>
<script type="text/javascript" src="../js/jq.js"></script>
<script type="text/javascript" src="../js/plugin/bootstrapvalidator/bootstrapValidator.min.js"></script>
<script type="text/javascript" src="../js/common.js"></script>
<script type="text/javascript" src="../layui/layui.js"></script>
<script type="text/javascript" src="../js/dict.js"></script>
<script type="text/javascript" src="../js/libs/jquery.ztree.all-3.5.min.js"></script>
<script type="text/javascript" src="../js/my/ztree-menu.js"></script>
<script type="text/javascript" src="../js/common.js"></script>
<script type="text/javascript">
    layui.use(['layer','laydate'], function(){
        var layer = layui.layer;
    });

    var elementId = getUrlParam('elementId');
    var elementName = getUrlParam('elementName');
    var elementSupplierId = getUrlParam('elementSupplierId');
    var elementSupplierName = getUrlParam('elementSupplierName');
    var entityName = getUrlParam('entityName');
    var treeRootName = getUrlParam('treeRootName') ? getUrlParam('treeRootName') : 'root';
    var mode = getUrlParam('mode');
    var isAll = getUrlParam('isAll');
    var notAllowSelectParent = getUrlParam('notAllowSelectParent') == 'true' ? true : false ;

    var treeId = entityName + 'Tree';
    $('#tree').prop('id', treeId);

    var dataUrl = $('#' + elementId, parent.document).val()
        ? ('/' + entityName + '/' + $('#' + elementId, parent.document).val())
        : '';
    // initTree(treeId, mode, '/' + entityName + '/tree?isAll=' + isAll, dataUrl, '', treeRootName);
    var settings = getSettings(mode);
    if (notAllowSelectParent) {
        settings.callback.beforeClick = zTreeBeforeClick;
    }
    initTree(treeId, settings, mode, '/' + entityName + '/tree?isAll=' + isAll, dataUrl, '', treeRootName);

    // function zTreeOnClick() {
    //     parent.selectParentId = getTreeSelectedId(treeId);
    // }

</script>
</body>
</html>
